package com.spt.springbootzhsx.controller;

import com.spt.springbootzhsx.entity.data.FloatData;
import com.spt.springbootzhsx.entity.data.IntegerData;
import com.spt.springbootzhsx.service.DiagramService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

@RestController
@RequestMapping(value="/diagram")
public class DiagramController {
    @Autowired
    private DiagramService diagramService;

    @GetMapping(value="/getMstateCount")
    public ArrayList<IntegerData> getMstateCount(){
        return diagramService.getMstateCount();
    }

    @GetMapping(value="/getUserTypeCount")
    public ArrayList<IntegerData> getUserTypeCount(){
        return diagramService.getUserTypeCount();
    }

    @GetMapping(value="/getMtypeCount")
    public ArrayList<IntegerData> getMtypeCount(){
        return diagramService.getMtypeCount();
    }

    @GetMapping(value="/getMovie_Top5Rate")
    public ArrayList<FloatData> getMovie_Top5Rate(){
        return diagramService.getMovie_Top5Rate();
    }

    @GetMapping(value="/getOrder_LastWeek")
    public ArrayList<IntegerData> getOrder_LastWeek(){
        return diagramService.getOrder_LastWeek();
    }
}
